**************************************************
* Setup Data Directories 
*************************************************
* Please set the working directory to the Code folder here


cd "C:\Users\bellona\Dropbox (Kenan-Flagler)\Projects\OG_PE_3\RFS Clean Submission\Replication - Simulated data\Clean"

*************************************************
* Packages
*************************************************

ssc install ftools, replace

ssc install reghdfe, replace

ssc install binscatter, replace

ssc install estout, replace


*************************************************
* Load the Data
*************************************************
local data "baseline matching_stacked_buyout matching_stacked_Drillco Production_well_level"
foreach var of local data {
import excel using "Base_Data.xlsx", first sheet("`var'") clear
save `var'.dta, replace
}

*************************************************
* Run the Do Files
*************************************************
log using results
* File to generate all tables
do Tables.do

* File to generate all figures
do Figures.do

log close